import request from '@/utils/request'

export function getList(data) {
  return request({
    url: '/course/allCourses',
    method: 'post',
    data: data
  })
}

export function getAllCourse(data) {
  return request({
    url: '/course/findAllCourse',
    method: 'post',
    data: data
  })
}

export function addCourse(data) {
  return request({
    url: '/course/addCourse',
    method: 'post',
    data: data
  })
}

export function deleteCourse(courseId) {
    return request({
      url: '/course/deleteCourse/'+courseId,
      method: 'delete'
    })
  }

  //上传封面
export function uploadPicture(data){
  return request({
    url: '/course/uploadCover',
    method: 'post',
    data:data
  })
}

export function openCourse(id){
  return request({
    url: '/course/openCourse/'+id,
    method: 'get',
  })
}
export function findCourseById(courseId){
  return request({
    url: '/course/findCourseById/'+courseId,
    method: 'post',
  })
}

export function findStudentByCid(formInLine){
  return request({
    url: '/course/findStudentByCid',
    method: 'post',
    data:formInLine
  })
}
 //上传视频
 export function uploadVideo(data){
  return request({
    url: '/course/uploadVideo',
    method: 'post',
    data:data
  })
}

export function DeleteCourseByUid(data){
  return request({
    url: '/course/DeleteCourseByUid',
    method: 'post',
    data
  })
}
